#!/usr/bin/env python
#coding=utf-8


def sanitize(time_string):
	"""
	清洗数据函数
	"""
	if '-' in time_string:
		splitter = '-'
	elif ':' in time_string:
		splitter = ':'
	else:
		return time_string
	(mins,secs)=time_string.split(splitter)
	return(mins + '.' + secs)

def get_coach_data(filename):
	"""
	读取文件
	"""
	try:
		with open(filename) as f:
			data = f.readline()
		return(data.strip().split(','))
	except IOError as e:
		print('File Error: ' + str(e))
		return(none)

james = get_coach_data('james.txt')
julie = get_coach_data('julie.txt')
mikey = get_coach_data('mikey.txt')
sarah = get_coach_data('sarah.txt')

print(sorted(set([sanitize(time) for time in james]))[0:3])
print(sorted(set([sanitize(time) for time in julie]))[0:3])
print(sorted(set([sanitize(time) for time in mikey]))[0:3])
print(sorted(set([sanitize(time) for time in sarah]))[0:3])
